/**	CODE EVAL::Easy [Hidden Digits]
 *	Digits hidden behind lower case lattin leters as follows:
 *	0 is behind 'a', 1 is behind 'b' etc, 9 is behind 'j'.
 *	Any other symbol means nothing
 *	Print out NONE in the case there are no digits in the string
 *
 *	Solution by Michael Pio Arroyo
 */

#include <iostream>
#include <fstream>
#include <string>

std::string Find(std::string a_line);

int main(int argc, char** argv) {
	std::ifstream file;
	std::string line;
	file.open(argv[1]);
	while(getline(file, line)) {
		std::cout << Find(line) << '\n';
	}
	file.close();
	return 0;
}

std::string Find(std::string a_line) {
	std::string found;
	size_t len = a_line.length();
	for(int i=0; i<len; ++i) {
		switch(a_line.at(i)) {
		case '0':
		case 'a': found.append("0"); break;
		case '1':
		case 'b': found.append("1"); break;
		case '2':
		case 'c': found.append("2"); break;
		case '3':
		case 'd': found.append("3"); break;
		case '4':
		case 'e': found.append("4"); break;
		case '5':
		case 'f': found.append("5"); break;
		case '6':
		case 'g': found.append("6"); break;
		case '7':
		case 'h': found.append("7"); break;
		case '8':
		case 'i': found.append("8"); break;
		case '9':
		case 'j': found.append("9"); break;
		default: break;
		}
	}
	if(found.empty())
		found = "NONE";
	return found;
}